import { createStore } from "vuex";

export default createStore({
  state: {
  	num:10,
  	sum:10,
  	str:'这是store数据'
  },
  getters:{
  	total( state ){
  		return state.num + state.sum;
  	}
  },
  mutations: {
  	changeNum( state , val ){
 		state.num = val;
  	}
  },
  actions: {
  	changeBtn(){
  		alert( 1 );
  	}
  },
  modules: {},
});
